package com.gobang.domain.message;

import lombok.*;

import java.io.Serializable;

/**
 * WebSocket落子请求消息
 * 用于处理WebSocket落子请求
 * 
 * @author System
 * @since 1.0.0
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
public class MoveRequestMessage extends WebSocketMessage {

    private static final long serialVersionUID = 1L;

    /**
     * 落子数据
     */
    private MoveRequestData data;

    /**
     * 落子响应数据内部类
     */
    @Data
    @AllArgsConstructor
    @Builder
    public static class MoveRequestData {
        /**
         * 房间ID
         */
        private String roomId;

        /**
         * 落子行坐标（0-14）
         */
        private Integer row;

        /**
         * 落子列坐标（0-14）
         */
        private Integer col;

        /**
         * 时间戳
         */
        private Long timestamp;

        public MoveRequestData() {
            this.timestamp = System.currentTimeMillis();
        }

    }

    /**
     * 构造函数
     */
    public MoveRequestMessage(MoveRequestData data) {
        super("MAKE_MOVE");
        this.data = data;
    }


}